package com.deanlib.cabinet.data.model;

import androidx.annotation.NonNull;

import org.greenrobot.greendao.annotation.Entity;
import org.greenrobot.greendao.annotation.Id;
import org.greenrobot.greendao.annotation.Index;
import org.greenrobot.greendao.annotation.Generated;
import org.greenrobot.greendao.annotation.OrderBy;
import org.greenrobot.greendao.annotation.Transient;

import java.io.Serializable;
import java.sql.Date;
import java.sql.Timestamp;
import java.util.List;


/**
 * 资源表
 * Created by Dean on 2022/6/28
 */
@Entity
public class Resource implements Comparable<Resource> {

    @Id
    public String md5;//唯一，用于标识一个资源
    public String newMd5;//压缩资源md5值
    public String path;//网络地址相对路径
    public String mineType;//资源类型 image/jpeg  video/mp4
    public Long resCreateTime;//资源生成时间 单位秒
    public Integer width;
    public Integer height;
    public Long size;//文件大小
    public Long duration;//视频时长
    public Double longitude;
    public Double latitude;
    public String locationDesc;//资源地理信息描述
    public String thumbnail;//封面
    public Long bitrate;//视频码率
    public Integer frameRate;//视频帧率
    @Transient
    public String labels;//标签
    @Transient
    public Timestamp createTime;//云端入库时间
    @Transient
    public List<User> owners;//资源拥有者
    @Transient
    public Boolean shared;//是否是他人共享给你的资源

    //-------local-------
    public String title;
    public Long dateModified;
    public String localPath;
    public String localThumbnail;
    public Boolean synced;//是否已经同步到了网络
    public Boolean notAllowShared;//该资源是否允许共享
    public Boolean backedUp;//是否通过备份服务器将文件做了备份


    @Generated(hash = 207093600)
    public Resource(String md5, String newMd5, String path, String mineType,
            Long resCreateTime, Integer width, Integer height, Long size,
            Long duration, Double longitude, Double latitude, String locationDesc,
            String thumbnail, Long bitrate, Integer frameRate, String title,
            Long dateModified, String localPath, String localThumbnail,
            Boolean synced, Boolean notAllowShared, Boolean backedUp) {
        this.md5 = md5;
        this.newMd5 = newMd5;
        this.path = path;
        this.mineType = mineType;
        this.resCreateTime = resCreateTime;
        this.width = width;
        this.height = height;
        this.size = size;
        this.duration = duration;
        this.longitude = longitude;
        this.latitude = latitude;
        this.locationDesc = locationDesc;
        this.thumbnail = thumbnail;
        this.bitrate = bitrate;
        this.frameRate = frameRate;
        this.title = title;
        this.dateModified = dateModified;
        this.localPath = localPath;
        this.localThumbnail = localThumbnail;
        this.synced = synced;
        this.notAllowShared = notAllowShared;
        this.backedUp = backedUp;
    }


    @Generated(hash = 632359988)
    public Resource() {
    }


    @Override
    public int compareTo(Resource o) {
        return resCreateTime>o.resCreateTime?-1:1;
    }


    public String getMd5() {
        return this.md5;
    }


    public void setMd5(String md5) {
        this.md5 = md5;
    }


    public String getNewMd5() {
        return this.newMd5;
    }


    public void setNewMd5(String newMd5) {
        this.newMd5 = newMd5;
    }


    public String getPath() {
        return this.path;
    }


    public void setPath(String path) {
        this.path = path;
    }


    public String getMineType() {
        return this.mineType;
    }


    public void setMineType(String mineType) {
        this.mineType = mineType;
    }


    public Long getResCreateTime() {
        return this.resCreateTime;
    }


    public void setResCreateTime(Long resCreateTime) {
        this.resCreateTime = resCreateTime;
    }


    public Integer getWidth() {
        return this.width;
    }


    public void setWidth(Integer width) {
        this.width = width;
    }


    public Integer getHeight() {
        return this.height;
    }


    public void setHeight(Integer height) {
        this.height = height;
    }


    public Long getSize() {
        return this.size;
    }


    public void setSize(Long size) {
        this.size = size;
    }


    public Long getDuration() {
        return this.duration;
    }


    public void setDuration(Long duration) {
        this.duration = duration;
    }


    public Double getLongitude() {
        return this.longitude;
    }


    public void setLongitude(Double longitude) {
        this.longitude = longitude;
    }


    public Double getLatitude() {
        return this.latitude;
    }


    public void setLatitude(Double latitude) {
        this.latitude = latitude;
    }


    public String getLocationDesc() {
        return this.locationDesc;
    }


    public void setLocationDesc(String locationDesc) {
        this.locationDesc = locationDesc;
    }


    public String getThumbnail() {
        return this.thumbnail;
    }


    public void setThumbnail(String thumbnail) {
        this.thumbnail = thumbnail;
    }


    public Long getBitrate() {
        return this.bitrate;
    }


    public void setBitrate(Long bitrate) {
        this.bitrate = bitrate;
    }


    public Integer getFrameRate() {
        return this.frameRate;
    }


    public void setFrameRate(Integer frameRate) {
        this.frameRate = frameRate;
    }


    public String getTitle() {
        return this.title;
    }


    public void setTitle(String title) {
        this.title = title;
    }


    public Long getDateModified() {
        return this.dateModified;
    }


    public void setDateModified(Long dateModified) {
        this.dateModified = dateModified;
    }


    public String getLocalPath() {
        return this.localPath;
    }


    public void setLocalPath(String localPath) {
        this.localPath = localPath;
    }


    public String getLocalThumbnail() {
        return this.localThumbnail;
    }


    public void setLocalThumbnail(String localThumbnail) {
        this.localThumbnail = localThumbnail;
    }


    public Boolean getSynced() {
        return this.synced;
    }


    public void setSynced(Boolean synced) {
        this.synced = synced;
    }


    public Boolean getNotAllowShared() {
        return this.notAllowShared;
    }


    public void setNotAllowShared(Boolean notAllowShared) {
        this.notAllowShared = notAllowShared;
    }


    public Boolean getBackedUp() {
        return this.backedUp;
    }


    public void setBackedUp(Boolean backedUp) {
        this.backedUp = backedUp;
    }
}
